﻿using System;
using System.IO.IsolatedStorage;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace XamlingCore.Infrastructure.Settings
{
    public static class SettingsHelper
    {
        private static IsolatedStorageSettings appSettings =
            IsolatedStorageSettings.ApplicationSettings;

        public static T Get<T>(string settingName)
        {
            if (appSettings.Contains(settingName))
            {
                return (T) appSettings[settingName];
            }

            return default(T);
        }

        public static void Set<T>(string settingName, T val)
        {
            appSettings[settingName] = val;
        }
    }
}
